Passed
Push — master ( 0a8095...60f354 )
by hung
01:03
created

rules.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
c 3
b 0
f 0
nc 1
dl 0
loc 1
rs 10
nop 1
1
const { statSync, readdirSync } = require('fs')
2
const { join } = require('path')
3
4
const isDirectory = ruleDir => statSync(ruleDir).isDirectory()
5
6
module.exports = {
7
  getAllRuleName: ruleDir =>
8
    readdirSync(ruleDir).filter(name => isDirectory(join(ruleDir, name))),
9
10
  load: path => require(path)
11
}
12